package IO流.缓冲流;

import java.io.*;
import java.nio.Buffer;

public class 字节缓冲流 {
    public static void main(String[] args) throws IOException {
        //1.创建缓冲流对象
        BufferedInputStream bis=new BufferedInputStream(new FileInputStream("F\\aaa\\a.txt"));
        BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("F\\copy.txt"));

        //2.进行拷贝
        byte[] b=new byte[1024];
        int len;
        while ((len= bis.read(b))!=-1){
            bos.write(b,0,len);
        }

        //3.关闭缓冲流
        bos.close();
        bis.close();
    }
}
